package mianshi.meituan;

import java.util.Scanner;


public class Main {


    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        for (int i = 0; i < n; i++) {
            int x = scanner.nextInt();
            int s = x;
            int count = 0;
            while (x > 0) {
                int t = x % 10;
                if (t == 1) {
                    count++;
                }
                x /= 10;
            }

            if (count >= 2 || s % 11 == 0) {
                System.out.println("Yes");
            } else {
                System.out.println("No");
            }

        }


    }
}
